package com.yw.atp.service;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import com.yw.atp.model.Phome;


@Repository
@Transactional
public class PhomeService{
	@PersistenceContext
    private EntityManager em;
	public Phome getPhome(){
		Query query = em.createQuery("select o FROM  Phome o where o.status = '0' order by o.id desc");
		return (Phome)((query.getResultList()!=null&&query.getResultList().size()>0)?query.getResultList().get(0):new Phome());
	}
}
